<?php 
include_once 'connection/connection_database.php';
include_once 'app/model/category/process.php';
include_once 'app/model/board/process.php';
include_once 'app/model/page/process.php';
include_once 'app/model/banner/process.php';
include_once 'app/model/support/process.php';
include_once 'app/model/lienket/process.php';
include_once 'app/base/counter.php';

$categories = new Categories();
$board = new Boards();
$page = new Pages();
$banner = new Banner();
$support = new Support();
$lienket = new LienKet();

$bannerRight1 = $banner->FillOneBanerRight1();
$bannerRight2 = $banner->FillOneBanerRight2();
$bannerRight3 = $banner->FillOneBanerRight3();
$result = $categories->FillAll();
$resultPageHotNews = $page->FillAllByHotNews();
$fillAllSupport = $support->FillAll();
$fillAllLienket = $lienket->FillAll();
?>
<?php if($_GET["menu"] != "") : ?>
<div id="support2">
    <div class="support">
        <div class="box-support">
            <h2><img src="images/call-phone.png" align="absmiddle" alt="Hỗ trợ trực tuyến" /> Hỗ trợ trực tuyến</h2>
        </div>
        <div class="box_support_center">
            <?php 
                $count = 1;
                while($rowSupport = mysql_fetch_array($fillAllSupport)) : 
            ?>
            <span>
                <?php if($rowSupport["level"] == 0) : ?>
                <h4>Luật sư</h4>                
                <?php endif; ?>
                <?php if($rowSupport["level"] == 1) : ?>
                <h4>Chuyên viên <?php echo $count; $count++; ?></h4>                
                <?php endif; ?>
                <a href="ymsgr:sendIM?<?php echo $rowSupport["yahoo_id"] ?>">
                    <img alt="Liên hệ qua Yahoo Messenger" src="http://opi.yahoo.com/online?u=<?php echo $rowSupport["yahoo_id"] ?>&m=g&t=1">
                </a>

                <script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js">
                </script>
                <a href="skype:<?php echo $rowSupport["skype_id"] ?>?call" onclick="return skypeCheck();">
                    <img src="http://mystatus.skype.com/smallclassic/<?php echo $rowSupport["skype_id"] ?>" width="70px" height="19px"/></a>
                <span class="red b"> <?php echo $rowSupport["phone"] ?></span>
            </span>
            <?php endwhile; ?>
        </div><!--End .box_support_center-->
        <div class="box_support_bottom"></div><!--End .box_support_bottom-->
    </div><!--End .support-->
    <div id="links-website2">
        <h2>Liên kết website</h2>
        <div class="items-link">
            <select name="cboLinkWeb" onchange="window.open(this.options[this.selectedIndex].value, '_blank')">
                <?php while($rowLienket = mysql_fetch_array($fillAllLienket)) : ?>
                <option value="<?php echo $rowLienket["lienket_link"] ?>" selected="selected"><?php echo $rowLienket["lienket_name"] ?></option>
                <?php endwhile; ?>
            </select>
        </div><!--End .items-link-->
    </div>
</div>
<?php endif; ?>
<div class="liked facebook gplus">
    <center>
        <a href="https://www.facebook.com/congty.bravolaw?ref=tn_tnmn"><img src="<?php echo $url["home"] ?>/images/1.png" alt="facebook" /></a>
        <a href="https://plus.google.com/u/0/108590969500808282657/posts" target="_blank"><img src="<?php echo $url["home"] ?>/images/4.png" alt="gpuls" /></a>
        <a href="https://twitter.com/CongtyBravo" target="_blank"><img src="<?php echo $url["home"] ?>/images/3.png" alt="twitter" /></a>
        <a href="http://vn.linkedin.com/in/bravolaw" target="_blank"><img src="<?php echo $url["home"] ?>/images/linkedin.png" alt="linkedin" /></a>
        <a href="<?php echo $url["home"] ?>/rss"><img src="<?php echo $url["home"] ?>/images/rss-2.png" alt="rss" /></a>
        <a href="mailto:ceo@bravolaw.vn" target="_blank"><img src="<?php echo $url["home"] ?>/images/email.png" alt="email" /></a>
    </center>
</div><!--End liked -->
<div id="slide_down_up">
    <?php while($rows = mysql_fetch_array($result)) : ?>
    <?php //$resultBoard = $board->FillAll($rows["category_id"]); ?>
    <?php $resultCategory = $page->FillByCategory($rows["category_id"]) ?>
    <h2><?php echo $rows["category_name"] ?></h2>
    <div class="list_category">
        <div class="box_slide_center">
            <?php while($rCategory = mysql_fetch_array($resultCategory)) : ?>
                <h3>
                    <a href="<?php echo $url["home"]."/".$rCategory["page_link"].".html" ?>">
                        <img src="<?php echo $url["home"] ?>/images/1349539112_bullet_black.png" alt="Bullet_icon" />
                            <?php echo $rCategory["page_title"] ?>
                    </a>
                </h3>
            <?php endwhile; ?>
        </div><!--End .box_slide_center-->
        <div class="box_slide_bottom"></div><!--End box_slide_bottom-->
    </div><!--End .list_category-->
    <?php endwhile; ?>
</div><!--End #slide_down_up-->

<div id="banner_right1">
    <a href="<?php echo $bannerRight1["banner_link"] ?>" target="_blank"><img src="<?php echo $bannerRight1["banner_url"] ?>" alt="Quảng cáo Bravo" width="264" height="200"/></a>
</div><!--End #banner_right1-->

<div id="featured_articles">
    <h2>
        <img src="<?php echo $url["home"] ?>/images/featured-article.png" alt="Bài viết nổi bật" align="middle"/>  Bài viết nổi bật
    </h2>
    <div class="box_featured_article_center">
        <marquee direction="down" behavior="scroll" scrolldelay="30" scrollamount="2" onmouseover="this.stop();" onmouseout="this.start();">
            <?php while($rowHotNews = mysql_fetch_array($resultPageHotNews)) : ?>
                <h2>
                    <a href="<?php echo $rowHotNews["page_link"].".html" ?>"><img src="<?php echo $url["home"] ?>/images/bullet-featured-article.png" align="absmiddle"><?php echo $rowHotNews["page_title"] ?></a>
                </h2>
            <?php endwhile; ?>
        </marquee>
    </div><!--End .box_featured_article_center-->
    <div class="box_featured_article_bottom"></div><!--End .box_featured_article_bottom-->
</div><!--End featured_articles-->

<div id="banner_right2">
    <a href="<?php echo $bannerRight1["banner_link"] ?>" target="_blank"><img src="<?php echo $bannerRight2["banner_url"] ?>" alt="Quảng cáo Bravo" width="264" height="200"/></a>
</div><!--End #banner_right2-->

<div id="social_facebook">
   <div id="fb-root"></div>
	<script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/vi_VN/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    
    <div class="fb-like-box" data-href="http://www.facebook.com/pages/Bravolaw/281940565264737?ref=hl" data-width="262" data-show-faces="true" data-stream="false" data-header="true"></div>
</div><!--End #socical_facebook-->

<div id="banner_right3">
    <?php while($bannerRows = mysql_fetch_array($bannerRight3)) : ?>
        <a href="<?php echo $bannerRight1["banner_link"] ?>" target="_blank"><img src="<?php echo $bannerRows["banner_url"] ?>" alt="Quảng cáo Bravo" width="264" height="100"/></a>
    <?php endwhile; ?>
</div><!--End #banner_right3-->

<div class="long2" id="map_canvas"></div><!--End #map_canvas-->
<div id="counter_visited">
    <h2><img src="<?php echo $url["home"] ?>/images/acount-online.png" alt="Icon account"/>  Thống kê lượt truy cập</h2>
    <div>
    	<!--<div><center><?php echo total(); ?></center></div>-->
        <div>
            <p>
            	<span><img src="<?php echo $url["home"] ?>/images/user_1.png" alt="Icon account"/> Hôm  nay : </span><span>    <?php echo today(); ?></span> 
            </p>
            <p>	
                <span><img src="<?php echo $url["home"] ?>/images/user_2.png" alt="Icon account"/> Hôm  qua : </span><span>	<?php echo yesterday(); ?></span> 
            </p>
            <!--<p>
                <span><img src="<?php echo $url["home"] ?>/images/user_3.png" alt="Icon account"/> Tuần  này</span><span>	9999</span> 
            </p>
            <p>
                <span><img src="<?php echo $url["home"] ?>/images/user_3.png" alt="Icon account"/> Tuần trước</span><span>	9999</span>
            </p>
            <p>   
                <span><img src="<?php echo $url["home"] ?>/images/user_4.png" alt="Icon account"/> Tháng này</span><span>	9999</span> 
            </p>
            <p>
                <span><img src="<?php echo $url["home"] ?>/images/user_4.png" alt="Icon account"/> Tháng trước</span><span>	9999</span> 
            </p>-->
            <p>
                <span><img src="<?php echo $url["home"] ?>/images/total_user.png" alt="Icon account"/> Tổng cộng : </span><span>	<?php echo total(); ?></span> 
            </p>
        </div>
    </div>
</div><!--End .counter_visited-->

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_floating_style addthis_counter_style" style="left:50px;top:50px;">
<a class="addthis_button_facebook_like" fb:like:layout="box_count"></a>
<a class="addthis_button_tweet" tw:count="vertical"></a>
<a class="addthis_button_google_plusone" g:plusone:size="tall"></a>
<a class="addthis_counter"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=xa-508f75b37450fd7e"></script>
<!-- AddThis Button END -->

<!--<div class="fb-like" data-href="https://www.facebook.com/LovePlus.vn" data-send="true" data-layout="button_count" data-width="450" data-show-faces="true"></div>
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>-->